/**
 * 
 */
package com.google.code.cisx.web;

import net.sourceforge.stripes.action.ActionBeanContext;
import net.sourceforge.stripes.action.ForwardResolution;
import net.sourceforge.stripes.action.Resolution;
import net.sourceforge.stripes.action.UrlBinding;

import com.google.code.cisx.model.project.ProjectGroup;

/**
 * @author <a href='mailto:rahul.thakur.xdev@gmail.com'>Rahul Thakur</a>
 * @version $Id: ManageProjectGroupActionBean.java 259 2008-11-29 13:18:52Z rahul.thakur.xdev $
 * @since 1.0
 */
@UrlBinding("/ManageProjectGroupEntity.action")
public class ManageProjectGroupActionBean extends ManageEntityActionBean<ProjectGroup> {

  @Override
  protected Class<ProjectGroup> getEntityClass() {
    return ProjectGroup.class;
  }

  @Override
  protected Resolution getResolution(ActionBeanContext context) {
    boolean hasErrors = context.getValidationErrors().size() > 0;
    String event = context.getEventName();
    if (event.equalsIgnoreCase("Save") && !hasErrors)
      return new ForwardResolution("/QueryProjectGroups.action");
    else
      return new ForwardResolution("/projectGroupEdit.jsp");
  }

  @Override
  protected void validate() {
    // TODO Auto-generated method stub

  }

}
